package ui;
import feffects.easing.Sine;
import js.Lib;
import params.GlobalParams;
import tools.ASprite;

/**
 * BG
 * @author PRASS
 */

class Background extends ASprite 
{

	private var _this 		: JQuery;
	private var _pic		: ASprite;
	
	public function new() 
	{	
		super(new JQuery("#bg"));
		setAlpha(0);		
		dom.css("background-image", "url("+GlobalParams.BG_MAIN+")");
	}
	
	public function display() : Void
	{
		tween(0, setAlpha, 1, 500, Sine.easeInOut,null);
	}

	
	public function resize( _w : Int , _h : Int, _bgW : Int, _bgH : Int, _bgX : Int, _bgY : Int ) : Void
	{
		dom.css("width", _w+"px");
		dom.css("height", _h+"px");
		
		dom.css("background-position", _bgX+"px "+_bgY+"px");
		dom.css("background-size", _bgW+"px "+_bgH+"px");
	}
	
}